|
I don't know, but it's generally not a good idea to use Abort. Try using a semaphore instead.
bool listen = false ;
Before starting the thread, set the semaphore to true .
In the thread use while ( listen )
Before stopping, set the semaphore to false , then use this.serverStart.Join to wait for the thread to exit.
http://msdn.microsoft.com/en-us/library/95hbf2ta(v=vs.110).aspx[^]
|
|
|
|
|
I want to generate summary report in GridView.
my database raw table is:
Table1
id userID feedBack timeStamp
1 user1 Excellent 2014-08-07 14:50:22.000
2 user2 Average 2014-08-07 14:50:42.000
3 user3 Good 2014-08-07 14:51:20.000
4 user4 Poor 2014-08-07 14:55:25.000
5 user1 Good 2014-08-07 14:57:02.000
based on that database table.
I want to show summary report in GridView as follow.
Report1
Input: DateRange
UserID Excellent Good Average Poor
user1 1 1 0 0
user2 0 0 1 0
user3 0 1 0 0
user4 0 0 0 1
that is , what I want to show in GridView .
it is more clear so that you friends can help me.
regards
modified 15-Aug-14 4:16am.
|
|
|
|
|
You need to use a PIVOT query on the data
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Oh Oh wait a chance for self promotio[^]n
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Whenever i look profile for interview, every one ask for share point and silver light. i don't understand it and its scope. please share what is the scope of sharepoint and silver light
RamK
|
|
|
|
|
Firstly this question has nothing to do with C#. And secondly, you need to make the effort to answer such questions for yourself. There is a wealth of information available to explain the basics of both technologies, at least enough for you to decide which one you want to learn.
|
|
|
|
|
Please how can I achieve this in a datagridview that when data is fetched from database, that each combo box will show a dropdown of the value of the Quantity it has fetched.
for an instance, if x gets 10,12,15,9,5,3
the first combobox will show a dropdown of 1 to 10, the second will show 1 to 12,...
DataGridViewComboBoxColumn dv = new DataGridViewComboBoxColumn();
dv.HeaderText = "myCombobox";
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "Select * from Toolz";
conn.Open();
reader = cmd.ExecuteReader();
while (reader.Read())
{
x = Reader.GetInt32(3);
}
foreach (DataGridViewRow dvx in dataGridView3.Rows)
{
y = Convert.ToInt32(dvx.Cells[3].Value.ToString());
}
for (g = 0; g < y; g++) ;
List<int> xl = new List<int>();
xl.Add(g);
foreach (DataGridViewComboBoxColumn dvx in dataGridView3.Rows)
{
dv.Items.Add(xl);
}
Keep the Dream Alive..
|
|
|
|
|
Please do not cross post.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I am testing a communicator frame where I have blocks of message contents which are pulled from database using visual studio telerik framework.
each message in database represents a Div on the UI.
each div has path something like
`
Pages.CareMechanix.FrameCommunicator.DOBDiv
Pages.CareMechanix.FrameCommunicator.DOBDiv0
Pages.CareMechanix.FrameCommunicator.DOBDiv1
Pages.CareMechanix.FrameCommunicator.DOBDiv2
`
I am getting the number of divs by `Pages.CareMechanix.FrameCommunicator.Find.AllByAttributes("class=cm-alert").Count;`
I am verifying if the number of messages in database is equal to number of divs.
In similar way, I want to verify the content in each div content is equal to corresponding message in database.
I would definitely not want to access each div content separately by path like below:
`Pages.CareMechanix0.FrameCommunicator.**DOBDiv**.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains, "| DOB: 00/27/1974" + "Patient ID: " + PatientID + sub);
Pages.CareMechanix0.FrameCommunicator.**DOBDiv0**.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains, "| DOB: 00/27/1974" + "Patient ID: " + PatientID + sub);
Pages.CareMechanix0.FrameCommunicator.**DOBDiv1**.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains, "| DOB: 00/27/1974" + "Patient ID: " + PatientID + sub);`
I would like to run a loop for the count to verify the text content.
**I am not sure of how to get each div content using a loop.**
Can someone please help me on this?
Please let me know if I am not clear anywhere.
I can explain.
|
|
|
|
|
Hello,
I am trying to work out the best way to play a video in full screen without the form displaying..
I have added the axWindowsMediaPlayer player to my form but I just cannot work out how to make it play full screen.
I have tried the code:
axWindowsMediaPlayer1.windowlessVideo = true;
But it seems to make no difference.
Ideally I am trying to make the video play full screen without any controls.
Can anyone suggest the best way to achieve this please?
Thanks
Trev
|
|
|
|
|
A quick Google shows me this AxWindowsMediaPlayer.fullScreen property[^]
if that doesn't work as expected I think you need to elaborate on your requirements
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Hi Simon,
Many thanks.
Apologies, I should have said I did try that as well..
When I do I get an error:
here is my code:
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
{
axWindowsMediaPlayer1.URL = @"C:\Users\trevo_000\Documents\visual studio 2013\Projects\Lance\Video Player\Loop.mp4";
axWindowsMediaPlayer1.fullScreen = true;
axWindowsMediaPlayer1.windowlessVideo = true;
}
And I get the error of:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in AxInterop.WMPLib.dll
Additional information: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Trev
|
|
|
|
|
You might want to read the documentation on the FullScreen property[^] and make sure you're setting up the MediaPlayer within the limits specified.
|
|
|
|
|
ok. can I go back to basics please? as I think I might be doing this wrong...
What am I trying to achieve...?
I am trying to write an app that, when it starts, immediately goes fullscreen and starts playing a video.
I then want the video to keep looping unless I tell the "video player" to change video.
I mostly write websites and APIs so my knowledge is way out of date in this area.
Is WMP the way to do this?
Thanks
|
|
|
|
|
Yes it is the way to do this.
No, it does not get you out of reading the documentation.
|
|
|
|
|
Member 4169628 wrote: immediately goes fullscreen All the examples I've seen set the fullscreen mode only when the state of the Player is Playing!
|
|
|
|
|
Hi,
i have a very strange problem with CheckBox ComboBox Extending the ComboBox Class and Its Items[^]
First, i have two of them on my form. When I check a Item in one of them, i call a method that reloads the entries of the second ComboBox consider which Item was selected in the first ComboBox, after that the method checks the Items which was checked before the entries of the second ComboBox were reload. This should work in two ways.
It works fine when I Select one Item in the first ComboBox and one item in the second ComboBox (My Method checks the "earlier checked Items of the other ComboBox") but when I select two or more Items in the second ComboBox the method dont checks the "earlier checked Items". I hope it was unterstandable, my english isn't the best...please ask when you have any questions.
Here is my Code.
1. ComboBox (cbArticle) CheckBoxCheckedChanged Event:
private void cbArticle_CheckBoxCheckedChanged(object sender, EventArgs e)
{
if (cbArticle.Text != "Artikel auswählen")
{
cbArticle.ForeColor = SystemColors.WindowText;
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
string[] arrMethods = cbMethod.Text.Split(',');
cbMethod.Items.Clear();
FillMethods();
cbMethod.CheckBoxCheckedChanged -= cbMethod_CheckBoxCheckedChanged;
for (int i = 0; i < arrMethods.Length; i++)
{
try
{
cbMethod.CheckBoxItems[arrMethods[i].Trim()].Checked = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
cbMethod.CheckBoxCheckedChanged += cbMethod_CheckBoxCheckedChanged;
}
else
{
cbArticle.ForeColor = SystemColors.GrayText;
FillMethods();
if (finished)
{
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
}
}
}
2. ComboBox (cbMethod) CheckBoxCheckedChanged Event:
private void cbMethod_CheckBoxCheckedChanged(object sender, EventArgs e)
{
if (cbMethod.Text != "Methode(n) auswählen")
{
cbMethod.ForeColor = SystemColors.WindowText;
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
string[] arrArticles = cbArticle.Text.Split(',');
cbArticle.Items.Clear();
FillGroupCodes();
cbArticle.CheckBoxCheckedChanged -= cbArticle_CheckBoxCheckedChanged;
for (int i = 0; i < arrArticles.Length; i++)
{
try
{
cbArticle.CheckBoxItems[arrArticles[i].Trim()].Checked = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
cbArticle.CheckBoxCheckedChanged += cbArticle_CheckBoxCheckedChanged;
}
else
{
cbMethod.ForeColor = SystemColors.GrayText;
FillGroupCodes();
if (finished)
{
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
}
}
}
When I debug the Code it works fine every time. I can see that the checkbox CheckedStatus is checked. But when the Method has ended and my Application switches back to the UI the CheckBoxes aren't checked... I call no other Methods (checked in debugger) but I can see that the CheckBoxComboBox.cs opens in Visual Studio it jumps in the following Code Blocks.
public partial class CheckBoxComboBox : PopupComboBox
{
#region EVENTS & EVENT HANDLERS
public event EventHandler CheckBoxCheckedChanged;
private void Items_CheckBoxCheckedChanged(object sender, EventArgs e)
{
OnCheckBoxCheckedChanged(sender, e);
}
#endregion
#region EVENT CALLERS and OVERRIDES e.g. OnResize()
protected void OnCheckBoxCheckedChanged(object sender, EventArgs e)
{
string ListText = GetCSVText(true);
if (DropDownStyle != ComboBoxStyle.DropDownList)
Text = ListText;
else if (DataSource == null)
{
Items[0] = ListText;
CheckBoxItems[0].ComboBoxItem = ListText;
}
EventHandler handler = CheckBoxCheckedChanged;
if (handler != null)
handler(sender, e);
}
...
}
[ToolboxItem(false)]
public class CheckBoxComboBoxItem : CheckBox
{
#region PROTECTED MEMBERS
protected override void OnCheckedChanged(EventArgs e)
{
if (_CheckBoxComboBox.DataSource != null)
{
PropertyInfo PI = ComboBoxItem.GetType().GetProperty(_CheckBoxComboBox.ValueMember);
PI.SetValue(ComboBoxItem, Checked, null);
}
base.OnCheckedChanged(e);
if (_CheckBoxComboBox.DataSource != null)
{
string OldDisplayMember = _CheckBoxComboBox.DisplayMember;
_CheckBoxComboBox.DisplayMember = null;
_CheckBoxComboBox.DisplayMember = OldDisplayMember;
}
}
#endregion
Please help me...I am totally frustrated after sitting 2-3 days on this issue...
|
|
|
|
|
If you have a question on an article, the best place to ask is in the forum at the bottom of that article: Comments[^]
The author of the article is usually the best person to help with the code they've written.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Of course, but I think the autho of this article is no longer active.
|
|
|
|
|
i hardly use generic. so anyone can explain what is generic and when one should use it. i like to know in what kind of situation developer use generic? i like to request to give some sample code which explain the good usage of generic.
what is the meaning of the below line
public class User : DBObject<User>
{
}
what is the meaning of this line specially
DBObject<User>
tbhattacharjee
|
|
|
|
|
Read this for an introduction and you'll get the idea (I hope): An Introduction to C# Generics[^]
In a nutshell: Generics enable one to make very general type definitions where types of subcomponents/parameters can be changed without changing the code of the type that uses them.
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
thanks for the help
but u did not answer for this line
public class User : DBObject<User>
{
}
what is the meaning of this line specially
DBObject<User>
tbhattacharjee
|
|
|
|
|
The meaning of "DBObject<User>" is the collection of User types,and the declaration of the public class User is an inherited class of DBObject<User>.
public class User : DBObject<User>
{
}
"Indian Hacker"
Debabrata Panigrahi.
|
|
|
|
|
Hi Debabrata,
thanks for answer. still things is not very clear to me. u said collection....ok. i have one more request. can you please write small full sample code similar to my situation which would explain well the usage like
DBObject<User>
looking for your help. thanks
tbhattacharjee
|
|
|
|
|
Read the link that was provided in the first answer to your question. That answers it all. Better still, actually read a book on this stuff. There are free ones available that are excellent. Charles Petzold's .NET Book Zero[^] is a great resource to help you get started. Seriously, you have to start doing some of this for yourself. If you don't, your career is going to go nowhere because all you have learned is that other people know things and you don't.
|
|
|
|